//package com.hzncc.scaffold.controller.other;
//
//
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import java.util.List;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.hzncc.scaffold.core.ResultT;
//import com.hzncc.scaffold.service.CourseService;
//import com.hzncc.scaffold.entity.Other.Course;
//import org.springframework.web.bind.annotation.RestController;
//
///**
// * <p>
// * 课程表 前端控制器
// * </p>
// *
// * @author DrunkBear
// * @since 2022-04-27
// */
//@RestController
//@RequestMapping("/course")
//@Api(tags = "课程表接口")
//public class CourseController {
//
//    @Resource
//    private CourseService courseService;
//
//    /**
//     * 查询表中所有信息
//     *
//     * @return
//     */
//    @GetMapping
//    @ApiOperation("查询所有课程表中数据")
//    public ResultT findAll() {
//        return ResultT.success(courseService.list());
//    }
//
//    /**
//     * 根据Id查询表中数据
//     *
//     * @param id
//     * @return
//     */
//    @GetMapping("/{id}")
//    @ApiOperation("根据Id查询课程表中数据")
//    public ResultT findOne(@PathVariable Integer id) {
//        return ResultT.success(courseService.getById(id));
//    }
//
//    /**
//     * 分页查询
//     *
//     * @param pageNum
//     * @param pageSize
//     * @return
//     */
//    @GetMapping("/page")
//    @ApiOperation("分页查询课程表中数据")
//    public ResultT findPage(@RequestParam Integer pageNum, @RequestParam Integer pageSize) {
//        QueryWrapper<Course> queryWrapper = new QueryWrapper<>();
//        return ResultT.success(courseService.page(new Page<>(pageNum, pageSize), queryWrapper));
//    }
//
//    /**
//     * 新增和更新接口
//     *
//     * @param
//     * @return
//     */
//    @PostMapping
//    @ApiOperation("新增或更新课程表中数据")
//    public ResultT save(@RequestBody Course course) {
//        courseService.saveOrUpdate(course);
//        return ResultT.success();
//    }
//
//    /**
//     * 根据Id删除表中数据
//     *
//     * @param id
//     * @return
//     */
//    @DeleteMapping("/{id}")
//    @ApiOperation("根据Id删除课程表中数据")
//    public ResultT delete(@PathVariable Integer id) {
//        courseService.removeById(id);
//        return ResultT.success();
//    }
//
//    /**
//     * 批量删除表中数据
//     *
//     * @param ids
//     * @return
//     */
//    @PostMapping("/del/batch")
//    @ApiOperation("批量删除课程表中数据")
//    public ResultT deleteBatch(@RequestBody List<Integer> ids) {
//        courseService.removeByIds(ids);
//        return ResultT.success();
//    }
//
//    @PostMapping("/queryByEntity")
//    @ApiOperation("条件查询")
//    public ResultT queryByEntity(Course course) {
//        LambdaQueryWrapper<Course> lqw = new LambdaQueryWrapper<>();
//        lqw.eq(course.getId() != null, Course::getId, course.getId());
//        lqw.eq(course.getTitle() != null, Course::getTitle, course.getTitle());
//        lqw.eq(course.getCover() != null, Course::getCover, course.getCover());
//        lqw.eq(course.getTeacher() != null, Course::getTeacher, course.getTeacher());
//        lqw.eq(course.getTeacherInfo() != null, Course::getTeacherInfo, course.getTeacherInfo());
//        lqw.eq(course.getCourseInfo() != null, Course::getCourseInfo, course.getCourseInfo());
//        lqw.eq(course.getAuthentation() != null, Course::getAuthentation, course.getAuthentation());
//        lqw.eq(course.getPublisherId() != null, Course::getPublisherId, course.getPublisherId());
//        lqw.eq(course.getStatus() != null, Course::getStatus, course.getStatus());
//        lqw.eq(course.getPubTime() != null, Course::getPubTime, course.getPubTime());
//        lqw.eq(course.getJoinedNum() != null, Course::getJoinedNum, course.getJoinedNum());
//        lqw.eq(course.getCreateTime() != null, Course::getCreateTime, course.getCreateTime());
//        lqw.eq(course.getStayAtTop() != null, Course::getStayAtTop, course.getStayAtTop());
//        lqw.eq(course.getSortTime() != null, Course::getSortTime, course.getSortTime());
//        lqw.eq(course.getIsDelete() != null, Course::getIsDelete, course.getIsDelete());
//        lqw.eq(course.getIsFree() != null, Course::getIsFree, course.getIsFree());
//        lqw.eq(course.getCertTemplate() != null, Course::getCertTemplate, course.getCertTemplate());
//        lqw.eq(course.getSetWidth() != null, Course::getSetWidth, course.getSetWidth());
//        lqw.eq(course.getSetHeight() != null, Course::getSetHeight, course.getSetHeight());
//        lqw.eq(course.getCoordinate() != null, Course::getCoordinate, course.getCoordinate());
//        lqw.eq(course.getIsQuestionLibExercise() != null, Course::getIsQuestionLibExercise, course.getIsQuestionLibExercise());
//
//
//        List<Course> courseList = courseService.list(lqw);
//        return ResultT.success(courseList);
//    }
//
//}
